from pydantic import BaseModel
from typing import List, Optional

class UserBase(BaseModel):
    username: str
    password: str

class UserCreate(UserBase):
    pass

class User(UserBase):
    id: int

    class Config:
        from_attributes = True

class PaginatedUserResponse(BaseModel):
    total: int  # 总记录数
    items: List[User]  # 当前页的数据
    skip: int  # 跳过的记录数
    limit: int  # 每页记录数